﻿using Furion;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;

namespace BaseNet.Core.Dtos
{
    /// <summary>
    /// 公共实体字段
    /// </summary>
    public class DEntityBase : PrivateEntityBase
    {
        public DEntityBase()
        {
            CreationTime = DateTimeOffset.Now;
            CreatorUserId = App.User?.FindFirstValue("UserId");
            CreatorUserName = App.User?.FindFirstValue("Account");
            IsDeleted = false;
        }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTimeOffset? CreationTime { get; set; }
        /// <summary>
        /// 创建人id
        /// </summary>
        public string CreatorUserId { get; set; }
        /// <summary>
        /// 创建人姓名
        /// </summary>
        public string CreatorUserName { get; set; }
        /// <summary>
        /// 最近更新时间
        /// </summary>
        public DateTimeOffset? LastModificationTime { get; set; }
        /// <summary>
        /// 最近更新人id
        /// </summary>
        public string LastModifierUserId { get; set; }
        /// <summary>
        /// 最近更新人姓名
        /// </summary>
        public string LastModifierUserName { get; set; }
        /// <summary>
        /// 删除时间
        /// </summary>
        public DateTimeOffset? DeletionTime { get; set; }
        /// <summary>
        /// 删除人id
        /// </summary>
        public string DeleterUserId { get; set; }
        /// <summary>
        /// 删除人姓名
        /// </summary>
        public string DeleterUserName { get; set; }
        /// <summary>
        /// 是否删除
        /// </summary>
        public bool? IsDeleted { get; set; }
    }
}
